from typing import List


class Solution:
    def finalValueAfterOperations(self, operations: List[str]) -> int:
        sum = 0
        for i in operations:
            if i =="X++":
                sum += 1
            elif i == "++X":
                sum += 1
            elif i == "--X":
                sum-=1
            else:
                sum -=1
        return  sum


if __name__ == '__main__':
    operations = ["--X", "X++", "X++"]
    solution = Solution()
    val = solution.finalValueAfterOperations(operations)
    print(val)